package com.hdy.javachatroomdemo.exception;

import com.hdy.javachatroomdemo.Enum.ResultCodeEnum;
import lombok.Data;

@Data
public class ServiceException extends RuntimeException {
    private String msg;
    private Integer code;
    public ServiceException() {}
    public ServiceException(String msg,Integer code) {
        this.msg = msg;
        this.code = code;
    }
    public ServiceException(ResultCodeEnum resultCodeEnum) {
        this.msg = resultCodeEnum.getMsg();
        this.code = resultCodeEnum.getCode();
    }
}
